<!DOCTYPE html>
<html>
	<head>
		<meta charset="utf-8">
<script src="http://apps.bdimg.com/libs/angular.js/1.4.6/angular.min.js"></script>

		<title></title>
	</head>
	<body ng-app="myApp">
		<!--
			currency 	格式化数字为货币格式。
filter 	从数组项中选择一个子集。
lowercase 	格式化字符串为小写。
orderBy 	根据某个表达式排列数组。
uppercase 	格式化字符串为大写。
		-->
		<div  ng-controller="personCtrl">

名: <input type="text" ng-model="firstName"><br>
姓: <input type="text" ng-model="lastName"><br>
<br>
姓名: {{fullName()|lowercase}}

</div>

<script>
var app = angular.module('myApp',  []);
app.controller('personCtrl', function($scope) {
    $scope.firstName = "John";
    $scope.lastName = "Doe";
    $scope.fullName = function() {
        return $scope.firstName + " " + $scope.lastName;
    }
});



</script>
		
	<!--
		
<div ng-app="myApp" ng-controller="namesCtrl">

<p>输入过滤:</p>

<p><input type="text" ng-model="test"></p>

<ul>
  <li ng-repeat="x in names | filter:test | orderBy:'country'">
    {{ (x.name | uppercase) + ', ' + x.country }}
  </li>
</ul>

</div>

		
	-->	
		
	<!--currency 过滤-->	
<div  ng-controller="costCtrl">

数量: <input type="number" ng-model="quantity">
价格: <input type="number" ng-model="price">

<p>总价 = {{ (quantity * price) | currency }}</p>

</div>
<script type="text/javascript">
	app.controller('costCtrl', function($scope) {
    $scope.quantity = 1;
    $scope.price = 9.99;
});



</script>
	<!---->
	<div ng-app="myApp" ng-controller="namesCtrl" style=";">

<p>循环对象:</p>
<ul>
  <li ng-repeat="x in names | orderBy:'country'">
    {{ x.name + ', ' + x.country }}
  </li>
</ul>

</div>
	
	
	</body>
</html>
